package com.luoy.base;

import scala.math.Ordering;

import java.lang.reflect.Field;

/**
 * @desc:
 * @author: luoy
 * @date: 2022-07-27 16:21
 */
public class StringTest {

    public static void main(String[] args) throws NoSuchFieldException, IllegalAccessException {
        String1();

        String a = "12";

    }


    public  static void String1() throws NoSuchFieldException, IllegalAccessException {
        String s = new String("adc");
        System.out.println(s);
        Class<? extends String> aClass = s.getClass();
        Field value = aClass.getDeclaredField("value");
        value.setAccessible(true);
        value.set(s,"abcd".toCharArray());
        System.out.println(s);

    }
}
